package com.amazon.service;

import com.amazon.bo.ShopClass;
import com.amazon.dao.ShopClassDao;
import com.amazon.web.util.Send253SMS;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("shopClassService")
public class ShopClassService {
    @Resource
    private ShopClassDao shopClassDao;
    @Resource
    private SMSCodeService smsCodeService;
    @Resource
    private Send253SMS send253SMS;
    @Resource
    I18nService i18nService;

    //经营分类列表
    public List<ShopClass> getClassList(int shopid){
        return shopClassDao.getClassList(shopid);
    }
    //分类
    public boolean save(ShopClass sc){
        if(sc.getId()==0) {
          int id=Integer.parseInt((shopClassDao.add(sc)).toString());
          if(id>0){
              return true;
          }else{
              return false;
          }
        }else{
             return shopClassDao.shopClassUpdate(sc);
        }
    }
    //品类明细
    public ShopClass getById(Long scid){
        return shopClassDao.getById(scid);
    }
}
